<?php

declare(strict_types=1);
/**
 * This file is part of Daley.
 *
 */
namespace App\Controller;

use App\Middleware\AuthMiddleware;
use Hyperf\HttpServer\Annotation\AutoController;
use Hyperf\HttpServer\Annotation\Middleware;

#[AutoController]
class MerchantController extends AbstractController
{
    public function index()
    {
        $user = $this->request->input('user', 'Api');
        $method = $this->request->getMethod();

        return [
            'method' => $method,
            'message' => "Hello {$user}.",
        ];
    }

    /**
     * 查看商户信息
     * @return string[]
     */
    #[Middleware(AuthMiddleware::class)]
    public function getInfo()
    {
        // 具体的业务逻辑

        return [
            '微信支付商户号' => '1607883421',
            '商户类型'      => '特约商户',
            '超级管理员姓名' => 'Daley',
            '手机号码'      => '1388888888'
        ];
    }

    /**
     * 订单统计
     * @return void
     */
    #[Middleware(AuthMiddleware::class)]
    public function orderCount()
    {
        // 具体的业务逻辑

        return '订单统计';
    }
}
